(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  this.MessagesModel = (function(_super) {

    __extends(MessagesModel, _super);

    function MessagesModel() {
      return MessagesModel.__super__.constructor.apply(this, arguments);
    }

    MessagesModel.prototype.defaults = {
      Messages: [],
      Size: 10,
      Page: 1,
      Direction: 0,
      Column: "Email",
      Filter: {
        Email: '',
        DateOfSend: ''
      }
    };

    MessagesModel.prototype.url = function() {
      var url;
      url = SiteMap.Messages.UserListing;
      url = url + "?page=" + this.attributes.Page;
      url = url + "&size=" + this.attributes.Size;
      url = url + "&Column=" + this.attributes.Column;
      url = url + "&Direction=" + this.attributes.Direction;
      url = url + "&Filter.Email=" + this.attributes.Email;
      url = url + "&Filter.DateOfSend=" + this.attributes.DateOfSend;
      return url;
    };

    MessagesModel.prototype.parse = function(response) {
      var item;
      item = {};
      item.Size = response.Size;
      item.Page = response.Page;
      item.TotalPages = response.TotalPages;
      item.Column = response.Column;
      item.Direction = response.Direction;
      item.Filter = {};
      if (response.Filter.Login != null) {
        item.Filter.Login = response.Filter.Login;
      }
      if (response.Filter.DateOfSend != null) {
        item.Filter.DateOfSend = response.Filter.DateOfSend;
      }
      item.Messages = response.Messages;
      return item;
    };

    return MessagesModel;

  })(Backbone.Model);

}).call(this);
